﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Code.Models;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using RuiJing.Web.Commen;

namespace RuiJing.Web.Areas.Manage.Models.NewsModels
{
    public class IndexModel
    {
        /// <summary>
        /// 分页，第几页
        /// </summary>
        public int? ID { get; set; }
        /// <summary>
        /// 分页，每页大小
        /// </summary>
        public int? A { get; set; }
        public int Size { get; set; }
        public int SumCount { get; set; }
        public IndexSerchModel Serch { get; set; }
        public IEnumerable<NewItem> News { get; set; }
        public List<SelectListItem> Languages { get; set; }
    }

    public class IndexSerchModel
    {
        public string Title { get; set; }
        public Language? Language { get; set; }
        public DateTime? StartTime { get; set; }
        public DateTime? EndTime { get; set; }
    }

    public class NewItem
    {
        public long ID { get; set; }
        public bool Highlight { get; set; }
        public NewState State { get; set; }
        public string Title { get; set; }
        public string Content { get; set; }
        public DateTime AddTime { get; set; }
        public int ClickCount { get; set; }
        public Language Language { get; set; }
    }

    public class EditNewModel
    {
        public long? ID { get; set; }
        [Required(ErrorMessage="*")]
        public bool Highlight { get; set; }
        [Required(ErrorMessage="*")]
        public NewState State { get; set; }
        [Required(ErrorMessage="*")]
        public string Title { get; set; }
        public string Content { get; set; }
        [Required(ErrorMessage="*")]
        public Language Language { get; set; }
        public DateTime? AddTime { get; set; }

        public string Action { get; set; }
        public IEnumerable<Language> Lanaguages { get; set; }

    }
}